package de.farbstreich.tozen2.client;

import java.awt.Color;
import java.awt.Dimension;

import javax.swing.JComponent;

import net.java.balloontip.BalloonTip;
import net.java.balloontip.styles.BalloonTipStyle;
import net.java.balloontip.styles.MinimalBalloonStyle;
import net.java.balloontip.utils.TimingUtils;

public final class ErrorMessage {

	private static BalloonTip errBalloon;
	private static BalloonTipStyle style = new MinimalBalloonStyle(new Color(246, 197, 192, 220), 5);

	public static void showErrorMessage(JComponent comp, String message) {
		/*if (errBalloon!=null) {
			errBalloon.closeBalloon();
		}*/
		
		errBalloon = new BalloonTip(comp, "<html><font color=\"#6f150d\">" + message + "</font></html>",
				style, BalloonTip.Orientation.RIGHT_ABOVE, BalloonTip.AttachLocation.ALIGNED, 15, 10, false);
		errBalloon.enableClickToHide(true);
		TimingUtils.showTimedBalloon(errBalloon, 5000);
	}
	
}
